import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './assets/css/style.less'
import './assets/font/iconfont.css'
import {parseTime} from './utils'
import hljs from 'highlight.js';
import 'highlight.js/styles/atom-one-dark.css'	//样式
// 引入markDown
import mavonEditor from 'mavon-editor'
import 'mavon-editor/dist/css/index.css'
import Element from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

Vue.directive('highlight',function (el) {
  let blocks = el.querySelectorAll('pre code');
  blocks.forEach((block)=>{
    hljs.highlightBlock(block)
  })
})

Vue.config.productionTip = false
Vue.filter('parseTime', (v) => parseTime(v,'{y}-{m}-{d}'))
Vue.filter('parseDateTime', (v) => parseTime(v,'{y}-{m}-{d} {h}:{i}:{s}'))
// 全局注入
Vue.use(mavonEditor)
// 引入element-ui
Vue.use(Element)

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
